<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>random随机数</title>
   </head>
   <body>
      <script>
         let arr = ['赵云', '马超', '黄忠', '关羽', '刘备', '张飞', '曹操', '周瑜', '诸葛亮']
         let random = Math.floor(Math.random() * arr.length)
         document.write(arr[random])
         console.log(arr.length)
         // 删除掉数组中的元素
         arr.splice(random, 1)
         console.log(arr)
      </script>
   </body>
</html>